package day03.abstracts;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/4/20
 */
public class Manager extends Employee {
    private double bonus;     // 分红
    // 构造方法
    public Manager(String name, String id, double pay, double bonus) {
        super(name, id, pay);
        this.bonus = bonus;
    }

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }

    // 员工类的抽象方法
    @Override
    public void addSalary() {
        double currentPay = getPay();
        setPay(currentPay + bonus);
    }
}
